package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.pojo.SysCompanyUser;
import com.nineclock.system.service.SysCompanyUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/organization")
public class OrganizationController {

    @Autowired
    private SysCompanyUserService sysCompanyUserService;

    /**
     * 修改管理员下拉列表查询当前企业所有员工
     * @return
     */
    @GetMapping("/members/simple")
    public Result selectCompanyUserAll() {
        List<SysCompanyUser> result = sysCompanyUserService.selectCompanyUserAll();
        if (result == null || result.size() == 0) {
            return Result.success("当前企业没有用户");
        }
        return Result.success(result);
    }

}
